package com.qst.service.impl;

import com.qst.dao.StudentMapper;
import com.qst.po.Student;
import com.qst.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements IStudentService {
@Autowired
private StudentMapper studentMapper;
    @Override
    public Student login(String name, String password) {
        return studentMapper.login(name,password);
    }

    @Override
    public int getstutoallcount() {
        return studentMapper.gettoallcount();
    }

    @Override
    public List<Student> getpage(int page, int limit) {
        return studentMapper.stugetpage((page-1)*limit, limit);
    }

    @Override
    public int addstudent(Student student) {
        return studentMapper.addstudent(student);
    }

    @Override
    public Student getstudentbyid(int id) {
        return studentMapper.getstubyid(id);
    }

    @Override
    public int updatestudent(Student student) {
        return studentMapper.updatestudent(student);
    }

    @Override
    public int deletestudent(int id) {
        return studentMapper.deletstudent(id);
    }
}
